home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 May: Tool Chest / Developer CD Series Tool Chest (Apple Computer)(May 1999).iso / Tool Chest / Development Kits / MPW etc / MPW-PR / Interfaces&Libraries / Multiprocessing StdCLib / CIncludes / string.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-03-06  |  3.5 KB  |  152 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        string.h
  3.  
  4.      Contains:    String handling
  5.  
  6.      Version:    Technology:    StdCLib 3.4
  7.                  Release:    3.6d2
  8.  
  9.      Copyright:    © 1987-1996 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. */
  18.  
  19.  
  20. /*
  21.  * Get common declarations 
  22.  */
  23.  
  24. #ifndef __STRING__
  25. #define __STRING__
  26.  
  27. #ifndef __CONDITIONALMACROS__
  28. #include <ConditionalMacros.h>
  29. #endif
  30. #ifndef __NULLDEF__
  31. #include <NullDef.h>
  32. #endif
  33. #ifndef __SIZETDEF__
  34. #include <SizeTDef.h>
  35. #endif
  36.  
  37.  
  38.  
  39.  
  40.  
  41. #if PRAGMA_ONCE_SUPPORTED
  42. #pragma once
  43. #endif  /* PRAGMA_ONCE_SUPPORTED */
  44.  
  45. #ifdef __cplusplus
  46. extern "C" {
  47. #endif
  48.  
  49. #if PRAGMA_IMPORT_SUPPORTED
  50. #pragma import on
  51. #endif
  52.  
  53. #if PRAGMA_ALIGN_SUPPORTED
  54. #pragma options align=mac68k
  55. #elif PRAGMA_PACK_SUPPORTED
  56. #pragma pack(push, 2)
  57. #endif
  58.  
  59. /*
  60.  *    Copying functions
  61.  */
  62.  
  63. extern void *memcpy(void *s1, const void *s2, size_t n);
  64. extern void *memmove(void *s1, const void *s2, size_t n);
  65. extern char *strcpy(char *s1, const char *s2);
  66. extern char *strncpy(char *s1, const char *s2, size_t n);
  67.  
  68. /* Apple library extentions.  The prefered mechanism for enabling these is by defining
  69.  * __useAppleExts__.  In the absence of this symbol, the __STDC__ symbol is used to
  70.  * enable or disable these extentions. */
  71.  
  72. #if defined(__useAppleExts__) || defined(applec) && !defined(__STDC__) || defined(__PPCC__) && !__STDC__
  73.  
  74. extern void *memccpy(void *s1, const void *s2, int c, size_t n);
  75.  
  76. #endif  /*  defined(__useAppleExts__)  || (( defined(applec)  &&  ! defined(__STDC__) ) || ( defined(__PPCC__)  &&  !__STDC__)) */
  77.  
  78.  
  79. /*
  80.  *    Concatenation functions
  81.  */
  82.  
  83. extern char *strcat(char *s1, const char *s2);
  84. extern char *strncat(char *s1, const char *s2, size_t n);
  85.  
  86. /*
  87.  *    Comparison functions
  88.  */
  89.  
  90. extern int memcmp(const void *s1, const void *s2, size_t n);
  91. extern int strcmp(const char *s1, const char *s2);
  92. extern int strcoll(const char *s1, const char *s2);
  93. extern int strncmp(const char *s1, const char *s2, size_t n);
  94. extern size_t strxfrm(char *s1, const char *s2, size_t n);
  95.  
  96. /*
  97.  *    Search functions
  98.  */
  99.  
  100. extern void *memchr(const void *s, int c, size_t n);
  101. extern char *strchr(const char *s, int c);
  102. extern size_t strcspn(const char *s1, const char *s2);
  103. extern char *strpbrk(const char *s1, const char *s2);
  104. extern char *strrchr(const char *s, int c);
  105. extern size_t strspn(const char *s1, const char *s2);
  106. extern char *strstr(const char *s1, const char *s2);
  107. extern char *strtok(char *s1, const char *s2);
  108.  
  109. /*
  110.     Re-entrant-safe "strtok". The function "strtok_r" is safe to 
  111.     use in re-entrant situations including preemptive
  112.     68k threads or preemptive tasks provided by the
  113.     Multiprocessing Library for PowerPC/System 7.
  114.     
  115.     To make the prototype for this function visible, 
  116.     you must #define _POSIX_THREAD_SAFE_FUNCTIONS 1
  117.     via command-line compiler-directive or equivalent
  118.     option.  This function is not available in versions
  119.     of StdCLib prior to 3.5a1.
  120. */
  121.  
  122. #if defined(_POSIX_THREAD_SAFE_FUNCTIONS)
  123. extern char *strtok_r(char *s1, const char *s2, char **lasts);
  124. #endif  /*  defined(_POSIX_THREAD_SAFE_FUNCTIONS)  */
  125.  
  126.  
  127. /*
  128.  *    Miscellaneous functions
  129.  */
  130.  
  131. extern void *memset(void *s, int c, size_t n);
  132. extern char *strerror(int errnum);
  133. extern size_t strlen(const char *s);
  134.  
  135.  
  136. #if PRAGMA_ALIGN_SUPPORTED
  137. #pragma options align=reset
  138. #elif PRAGMA_PACK_SUPPORTED
  139. #pragma pack(pop)
  140. #endif
  141.  
  142. #if PRAGMA_IMPORT_SUPPORTED
  143. #pragma import off
  144. #endif
  145.  
  146. #ifdef __cplusplus
  147. }
  148. #endif
  149.  
  150. #endif /* __STRING__ */
  151.  
  152.